# -*- coding: UTF-8 -*-
"""
@Project: political_selection
@File: main.py
@Date ：2024/2/18 9:13
@Author：Amlei (lixiang.altr@qq.com)
@version：python 3.12
@IDE: PyCharm 2023.2
"""

from data import classify_material


def init_political_selection(classify: int, material: int) -> list[int]:
    """
    初始化数据
    :return:
    """
    ret: list[int] = []
    match classify:
        case 1:
            ret = classify_material["毛概"][material]
        case 2:
            ret = classify_material["新思想"][material]

    return ret


def entry() -> list[int]:
    classify: int = int(input("请输入类型(数字即可):\n"
                              "1.毛概\t2.新思想\n"))
    material: int = int(input("请输入材料类型(数字即可)\n"
                              "1.齐老师\t2.欢姐\t3.CB398\n"))
    chapter: int = int(input("请输入章节:"))

    fail_num: int = int(input("错题总数:"))

    return [classify, material, chapter, fail_num]


def main() -> None:
    ent: list[int] = entry()
    data: list[int] = init_political_selection(ent.pop(0), ent.pop(0))
    chapter: int = ent.pop(0)
    fail_num: int = ent.pop(0)
    print(f"第{chapter}章, 共{data[chapter]}道, 错{fail_num}道")
    print(f"正确率: {int(((data[chapter] - fail_num) / data[chapter]) * 100)}%")


if __name__ == '__main__':
    main()
    